home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
2499.ZIP
/
TIMEIT.ZIP
/
TIMEIT.DOC
< prev
next >
Wrap
Text File
|
1989-02-15
|
1KB
|
39 lines
TIMEIT.C -- Windows program timer application for Microsoft Windows
Written by Steve Burg
Adapted from "FREEMEM.C" uploaded by Charles Petzold
This is a small windows application program that can be used to time
segments of a windows development programmers code. The program uses
DDE messages to start and stop timing, displaying the elapsed time in
the icon area.
During program development the START_TIMER and STOP_TIMER calls can be
placed in the code to time a event. The Timeit program will display the
elapsed time between start and stop messages.
#include "timeit.h"
.
.
.
START_TIMER(hWnd)
Code being timed
STOP_TIMER(hWnd)
.
.
.
Since the DDE Initiate message uses AddGlobalAtom for the DDE Application
name which the Timeit program deletes. If the timeit program is not running
when the START_TIMER call is made a GlobalAtom will be left behind in
memory. GlobalAddAtom stores no more than one copy of a given string in
the atom table, so succesive calls use no more memory, unless the atom
count overflows, leaving calls in during program development should not
cause problems.
The program is useful for development programmers, working on optimizing
a section of code. Complete source code is included for those that
need to modify the code for specific purposes.
Steve Burg
02/15/88